#@datagrid()
#define content_header()
<h1>
    <a href="/middleman">居间商管理</a>
    <small>middleman tables</small>
</h1>
<ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
    <li><a href="#">代理</a></li>
    <li class="active">居间商管理</li>
</ol>
#end
#define content()
<div class="box">
    <div class="box-header">
        <div class="row">
            <div class="col-md-5">
                <button type="button" class="btn btn-sm btn-default navbar-btn xsui-btn-add-dialog" data-url="/middleman/edit" title="新增居间商">创建居间商</button>
            </div>
            <div class="col-md-7">
                <form class="navbar-form navbar-right" action="/middleman/1">
                    <div class="form-group">
                        <input type="text" name="word" class="form-control input-sm" placeholder="用户ID..." title="" value="#(word)">
                    </div>
                    <button type="submit" class="btn btn-sm btn-default">搜索</button>
                </form>
            </div>
        </div>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <table class="xsui-datagrid table table-condensed table-bordered table-striped table-hover">
            <thead>
                <tr>
                    <th>代理商ID</th>
                    <th>关联ID</th>
                    <th>公司名称</th>
                    <th title="只包含代理">下线数量</th>
                    <th title="包含代理和非代理">会员数量</th>
                    <th>账户余额</th>
                    <th>当日充值</th>
                    <th>当日提现</th>
                    <th>累计充值</th>
                    <th>累计提现</th>
                    <th>状态</th>
                    <th>代理注册模式</th>
                    <th>创建时间</th>
                </tr>
            </thead>
            <tbody>
                #for(x : listPage.getList())
                <tr data-key="#(x.user_id)">
                    <td><a href="/middleman/childagent?top_agent_id=#(x.top_agent_id)" title="查看详情">#(x.top_agent_id)</a></td>
                    <td><a href="/middleman/edit?user_id=#(x.user_id)"  class="xsui-btn-edit-dialog"  title="编辑分销代理 - #(x.nickname)">#(x.user_id)</a></td>
                    <td>#(x.nickname)</td>
                    <td>#(x.child_agent_count)</td>
                    <td>#(x.child_agent_count+x.child_user_count)</td>
                    <td>#(x.blance)</td>
                    <td>#(x.recharge_amount_today)</td>
                    <td>#(x.withdraw_amount_today)</td>
                    <td>#(x.recharge_amount_total)</td>
                    <td>#(x.withdraw_amount_total)</td>
                    <td>#(x.user_status.toString() == "1" ? "正常":"冻结")</td>
                    <td>#(x.is_free_regist_agent.toString() == "0" ? "<span style='color:#090'>免费注册</span>":"<span style='color:#F00'>付费注册</span>")</td>
                    <td>#(x.registTimeText)</td>
                </tr>
                #end
            </tbody>
        </table>
        <!--分页条-->
        <table>
            <tr>
                <td>#@paginate(listPage.pageNumber, listPage.totalPage, "/middleman/")</td>
                <td><div class="xsui-datagrid-info">共<span class="text-danger">#(listPage.getTotalRow())</span>条</div></td>
            </tr>
        </table>
    </div>
    <!-- /.box-body -->
</div>
<!-- /.box -->
#end